home *** CD-ROM | disk | FTP | other *** search
- //-------------------------------------------------------
- // GenDLL.C
- //-------------------------------------------------------
- // Contains code for Generic DLL.
- //
- // Use the following files as templates for building your
- // own DLL:
- //
- // - GenDLL.C (this file)
- // - GenDLL.H
- // - GenDLL.DEF
- //-------------------------------------------------------
-
- #include <windows.h>
- #include "GENDLL.H"
-
- //------------------------------------------------------
- // Global Variables
- //------------------------------------------------------
- HANDLE hmodDLL;
-
-
- //------------------------------------------------------
- // Prototypes
- //------------------------------------------------------
-
-
- //------------------------------------------------------
- // Initialize library. This routine is called when the
- // first client loads the DLL.
- //------------------------------------------------------
- int FAR PASCAL LibMain
- (
- HANDLE hModule,
- WORD wDataSeg,
- WORD cbHeapSize,
- LPSTR lpszCmdLine
- )
- {
- // Avoid warnings on unused formal parameters
- wDataSeg = wDataSeg;
- cbHeapSize = cbHeapSize;
- lpszCmdLine = lpszCmdLine;
-
- hmodDLL = hModule;
-
- return 1;
- }
-
-
-
-
- //------------------------------------------------------
- // WEP
- //------------------------------------------------------
- // C7 and QCWIN provide default WEP:
- //------------------------------------------------------
- #if (_MSC_VER < 610)
-
- int FAR PASCAL WEP(int fSystemExit);
-
- //------------------------------------------------------
- // For Windows 3.0 it is recommended that the WEP
- // function reside in a FIXED code segment and be
- // exported as RESIDENTNAME. This is accomplished
- // using the alloc_text pragma below and the related
- // EXPORTS and SEGMENTS directives in the .DEF file.
- //
- // Read the comments section documenting the WEP
- // function in the Windows 3.1 SDK "Programmers
- // Reference, Volume 2: Functions" before placing
- // any additional code in the WEP routine for a
- // Windows 3.0 DLL.
- //------------------------------------------------------
- #pragma alloc_text(WEP_TEXT,WEP)
-
- //------------------------------------------------------
- // Performs cleanup tasks when the DLL is unloaded.
- // WEP() is called automatically by Windows when the DLL
- // is unloaded (no remaining tasks still have the DLL
- // loaded). It is strongly recommended that a DLL have a
- // WEP() function, even if it does nothing but returns
- // success (1), as in this example.
- //------------------------------------------------------
- int FAR PASCAL WEP
- (
- int fSystemExit
- )
- {
- // Avoid warnings on unused formal parameters
- fSystemExit = fSystemExit;
-
- return 1;
- }
- #endif // C6
-
- //------------------------------------------------------
-
-
-